#-*- mode:python -*-

from twisted.python import log
from twisted.application import service, internet
from twisted.protocols import http
from twisted.internet import protocol
from twisted.internet import reactor

from activist.web.ActivistHTTPFactory import createFactory
from activist.util import activistLogObserver

# emails errors; see Config.email_errors_to
log.addObserver(activistLogObserver)

from activist.DataStore import DataStore
from activist.CommandProcessor import CommandProcessor
CommandProcessor.loadAndProcess()

application = service.Application("activist")
myFactory = createFactory()
internet.TCPServer(8080, myFactory).setServiceParent(application)

## testing error reporter
##def raiseAnError():
##    raise "I'm an error!"
##reactor.callLater(5,raiseAnError)
